function checkTime(i)
{
    if(i<10)
    {
        i="0"+i;
    }
    return i;
}
var time = setInterval('showTime()',500);
function showTime()
{
    // 倒计时到什么时间
  　var timedate= new Date("2019/2/4,00:00:00");                //自定义结束时间  
　　var now = new Date();                                         //获取当前时间
　　var date = parseInt(timedate.getTime() - now.getTime())/1000; //得出的为秒数；
　  if(date <= 0)
　  {
　      document.getElementById("txtshow").innerHTML="倒计时已经结束";
　      clearInterval(time);
　  }
　　var day = parseInt(date/60/60/24);     
    var hour = parseInt(date/60/60%24);
    var minute = parseInt(date/60%60);
    var second = parseInt(date%60);
    hour = checkTime(hour);
    minute = checkTime(minute);
    second = checkTime(second);
    var leftTime = hour+":"+minute+":"+second;
    document.getElementById('timeShow').innerHTML = leftTime;
    time;        
}